<?php
    
   require_once('includes/general.php');
   if(!tep_db_checkDb()) die('khong ket noi dc csdl');   
?>

<?php
@session_start();        // Khoi dong session    
$s_id = session_id();    // Bien s_id        
$time = time();            // Lay thoi gian hien tai 
$time_secs = 900;        // Thoi gian tinh bang seconds de delete & insert cai $s_id    moi, test tren localhost thi cho no bang 3 seconds de nhanh thay ket qua, ch?y trên host thì d? 900 = 15 phút là v?a 
$time_out = $time - $time_secs;    // Lay thoi gian hien tai    

@mysql_query("DELETE FROM tbl_stats WHERE s_time < '$time_out'");                // Delete tat ca nhung rows trong khoang thoi gian qui dinh san
@mysql_query("DELETE FROM tbl_stats WHERE s_id = '$s_id'");                        // Delete cai $s_id cua chinh thang nay
@mysql_query("INSERT INTO tbl_stats (s_id, s_time) VALUES ('$s_id', '$time')");    // Delete no xong lai insert chinh no
$user_online = @mysql_num_rows(@mysql_query("SELECT id FROM tbl_stats"));        // Dem so dong trong table stats, chinh la so nguoi dang online
// Them 1 cai, xem page nay da duoc mo bao nhieu lan:
list($page_visited) = @mysql_fetch_array(@mysql_query("SELECT MAX(id) FROM tbl_stats"));
// Xong rui, cho no ra thui
//echo "Online: <b>".$user_online."</b><br>";
//echo "Trang nay duoc mo: <b>".$page_visited."</b> lan";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta name="author" content="thihien" />
    <link href="css/reset.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<script type="text/javascript" src="js/swfobject.js"></script>

	<title>Yen Sao Lina</title>
    
</head>

<body>

    <!-- bat dau warrper -->
    <div id="wrapper">
        <!-- bat dau header -->
        <div id="header">
            <!-- bat dau banner -->
            <div id="banner">
                <object id="Object2" width="972" height="184" border="0" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000">
                    <param value="flash/topyensao2.swf" name="movie">
                    <param value="High" name="quality">
                    <param value="transparent" name="wmode">
                    <embed width="972" height="186" type="application/x-shockwave-flash" src="flash/topyensao2.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" name="obj1">
                </object>
            </div>
            <!-- ket thuc banner -->
            
            <!-- bat dau menutop -->
            <div id="menu_top">
              <div id="menu_top_1">  
                    <ul>
                        <li>
                            <a href="<?php echo '?page=trangchu' ?>" class="trangchu" style="border-left: none;">Trang chủ</a>
                        </li>
                        
                         <li>
                            <a href="<?php echo '?page=gioithieu' ?>" class="gioithieu">giới thiệu</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=sanpham' ?>" class="sanpham">sản phẩm</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=congnghe' ?>" class="congnghe">công nghệ</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=tintuc' ?>" class="tintuc">tin tức</a>
                        </li>
                         <li>
                            <a href="<?php echo '?page=hoatdong' ?>" class="hoatdong">hoạt động</a>
                        </li>
                        <li>
                            <a href="<?php echo '?page=lienhe' ?>" class="lienhe">liên hệ</a>
                        </li>
                    </ul>
              </div>
                    
            </div>
            <!-- ket thuc menutop -->
        </div>
        <div id="duongvien"></div>
        <!-- ket thuc header -->    
        
        <!-- bat dau main -->
        <div id="main">
            <!-- bat dau menu left -->
            
            <div id="menu_left">
                <div id="menu_dm">
                    <div   class="tieude"><h3>danh mục sản phẩm</h3></div>
                    <div id="danhmucsanpham">
                        <ul>
                            <?php
                                $sql='select * from tbl_danh_muc_san_pham ';
                                $kq=tep_db_query($sql);
                                while($item=tep_db_fetch_array($kq)){  
                            ?>
                                    <li>
                                        <a href="<?php echo '?madanhmuc='.$item['id'].''?>"><?php echo ''.$item['ten_danh_muc'].'' ?></a>
                                    </li>
                                    
                            <?php } ?>
                            
                        </ul> 
                    </div>
                </div>
                <div id="phimtailieu">
                    <div class="tieude"><h3>phim tài liệu</h3></div>
                    <div id="phim_tai_lieu">
                        <?php
                            $sql='select * from tbl_video where hien_len_trang_chu=1 order by id desc limit 1';
                            $kq=tep_db_query($sql);
                            while($item=tep_db_fetch_array($kq)){ 
                                 echo '<div id="nvplayer">
                   
                                </div>
                                <script type="text/javascript">
                					var video = new SWFObject("player.swf","playlist","248","183","0");
                					video.addParam("allowfullscreen","true");
                					video.addParam("wmode","opaque");
                					video.addVariable("file","video/'.$item['ten_video'].'"); 
                					video.addVariable("displayheight","160"); 
                					video.addVariable("thumbsinplaylist","false");
                					video.addVariable("width","220");
                					video.addVariable("height","180");
                					video.addVariable("backcolor","0x000000");
                					video.addVariable("frontcolor","0xCCCCCC");
                					video.addVariable("lightcolor","0x557722");video.addVariable("lightcolor","0x557722");
                					video.addVariable("shuffle","true"); 
                					video.addVariable("repeat","list");
                					video.addVariable("icons","true");
                					video.addVariable("fullscreen","true");
                					video.write("nvplayer"); 
                				</script> '; 
                        
                           } 
                         ?>
                    </div>
                </div>
                <div class="tintuctieudiem1">
                    <div  class="tieude"><h3>Tin tức tiêu điểm</h3></div> 
                    <div id="tintuc_tieudiem1">
                        <?php
                            $sql1='select * from tbl_tin_tuc where hien_len_trang_chu=1';
                            $kq1=tep_db_query($sql1);
                            while($item1=tep_db_fetch_array($kq1)){ ?>
                                <div class="tin_tuc">
                                    <div class="hinhanh_tintuc1"><a href="<?php echo '?page=tintuc&matintuc='.$item1['id'].'&mode=detail' ?>"><img height="60" width="60" src="<?php echo 'admin/upload/'.$item1['hinh_anh'].'' ?>" /></a></div>
                                    
                                    <div class="noidung_tintuc1">
                                        <p><a href="<?php echo '?page=tintuc&matintuc='.$item1['id'].'&mode=detail' ?>" style="text-decoration: none; font-weight: bold; color: blue; margin-top: 20px;"><?php echo ''.$item1['tieu_de'].'' ?></a></p><br />
                                        <p> <?php echo ''.$item1['mo_ta_ngan_gon'].'' ?> </p>  
                                        <p><a href="<?php echo '?page=tintuc&matintuc='.$item1['id'].'&mode=detail' ?>" style="color: red; float: right;; text-decoration: none;">chi tiết >></a></p>                       
                                    </div>
                                    <div style="text-align: center;">.....................................................</div>
                                    <div class="clear"></div>
                                </div>
                         <?php
                            } 
                        ?>
                        
                       
                       
                   </div>  
                </div> 
                 <div class="tieude"><h3>tỉ giá ngoại tệ</h3></div>
                 <div id="tigiangoaite">
                    <ul>
                        <li style="background: url(images/bg_thoitiet.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/thoitiet/thoitiet.php' ?>">thời tiết</a></li>
                        <li style="background: url(images/bg_giavang.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://hn.24h.com.vn/ttcb/giavang/giavang.php' ?>">giá vàng hôm nay</a></li>
                        <li style="background: url(images/bg_tigia.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.vietcombank.com.vn/exchangerates' ?>">tỉ giá ngoại tệ</a></li>
                        <li style="background: url(images/bg_chungkhoan.jpg) no-repeat scroll left center transparent;"><a href="<?php echo 'http://www.hsx.vn/LS_VSE/HoSTC_Livesecurity.htm' ?>">chứng khoán trực tuyến</a></li>
                    </ul>
                 </div>
                 <div class="tieude"><h3>thống kê website</h3></div>
                 <div id="thongkewebsite">
                    <div id="hinh_web"><img src="images/hinh_web.jpg"/></div>
                    <div id="thongtin">
                        <p>online:&nbsp;<?php echo '0'.$user_online; ?></p>
                        <p>Tổng lượt:&nbsp;<?php echo $page_visited; ?></p>
                    </div>
                    <div class="clear"></div>
                   
                        <select class="lienket" onChange="MM_jumpMenu('parent',this,0)">
                            <option>chọn liên kết website</option>
                            <?php 
                                    $sql4='select * from tbl_lien_ket_web';
                                    $kq4=tep_db_query($sql4);
                                    while($item=tep_db_fetch_array($kq4)){
                                    
                                        echo '<option><a href="'.$item['link_lien_ket'].'">'.$item['link_lien_ket'].'</a></option>' ;
                                      
                                    }
                             ?>
                            
                        </select>
                  
                 </div>
                          
            </div>
            <!-- ket thuc menu left -->
            
            <!-- bat dau content -->
            <?php 
            
                if(isset($_GET['page']) && $_GET['page']=='gioithieu'){
                    require_once('gioithieu.php');
                }
                elseif(isset($_GET['page']) && $_GET['page']=='sanpham'){
                    require_once('sanpham.php');
                }
                elseif(isset($_GET['madanhmuc'])){
                    require_once('sanphamtheodanhmuc.php');
                }elseif(isset($_GET['page']) && $_GET['page']=='congnghe'){
                    require_once('congnghe.php');
                }
                elseif(isset($_GET['page']) && $_GET['page']=='tintuc'){
                    require_once('tintuc.php');
                }
                
                elseif(isset($_GET['page']) && $_GET['page']=='lienhe'){
                    require_once('lienhe.php');
                }
                 elseif(isset($_GET['page']) && $_GET['page']=='hoatdong'){
                    require_once('hoatdong.php');
                }
                elseif(isset($_GET['page']) && $_GET['page']=='sanphamdathuchien'){
                    require_once('sanphamdathuchien.php');
                }else{
            
            ?>
            <div id="content">
                <!-- bat dau gioi thieu va lien he truc tuyen -->
                <div class="gioithieu_lienhetructuyen">
                    <!-- bat dau gioi thieu -->
                    <div class="gioithieu1">
                        <div class="tieude" id="tieude_gioithieu"><h3>Giới thiệu</h3></div>
                        <?php
                            $sql5='select * from tbl_gioi_thieu'; 
                            $kq5=tep_db_query($sql5);
                            $item2=tep_db_fetch_array($kq5);
                        ?>
                        <div class="hinhanh_gt"><a href="<?php echo '?page=gioithieu' ?>"><img  src="<?php echo 'admin/upload/'.$item2['hinh_anh'].'' ?>"/></a></div>
                        <div class="mota_gioithieu1"><?php echo ''.$item2['noi_dung_ngan_gon'].'' ?><br />
                            <a href="<?php echo '?page=gioithieu' ?>" >chi tiết....</a>
                        </div>
                    </div>
                        
                    <!-- ket thuc gioi thieu -->
                    
                    <!-- bat dau lien he truc tuyen -->
                    <div class="lienhetructuyen" >
                        <div class="tieude" id="tieude_lienhetructuyen"><h3>Liên hệ trực tuyến</h3></div>
                        <div class="tructuyen1">
                            <div id="lienhetructuyen">
                            <p>Hot Line: <span style="color: red;">0866 509 022</span></p>
                            <p>Mobile:<span style="color: red; padding-left: 17px;">0972 814 499</span></p>
                            </div>
                        
                            <div id="hotro">Hỗ trợ trực tuyến</div>
                            <div><a href="ymsgr:sendIM?hoanghung2409" style="border: none;"><img style="text-align: center; margin-left: 57px; margin-top: 10px; border: none;"src="images/hotro1.jpg"/></a></div>
                            <div style="margin-left: 37px;margin-top: 5px;font-weight: bold;">Nhân Viên Kinh Doanh</div>
                            <div><a href="ymsgr:sendIM?hoanghung2409" style="border: none;"><img style="text-align: center; margin-left: 57px; margin-top: 10px; border: none;"src="images/hotro2.jpg"/></a></div>
                            <div style="margin-left: 37px;margin-top: 5px; font-weight: bold; margin-bottom: 10px;">Nhân Viên Kinh Doanh</div>
                        </div>
                    </div>
                    <!-- ket thuc lien he truc tuyen -->
                    <div class="clear"></div>
                </div>
                <!-- ket thuc gioi thieu va lien he truc tuyen -->
                <!-- bat dau nha va thiet bi nuoi yen --> 
                 
                    <div id="nhavacacthietbinuoiyen">
                        <div class="tieude" id="tieude_thietbinuoiyen"><h3>nhà và các thiết bị nuôi yến</h3></div>
                            <?php
                                $sql5='select * from tbl_san_pham where hien_len_trang_chu=1 '; 
                                $kq5=tep_db_query($sql5);
                                while($item=tep_db_fetch_array($kq5)){?>
                                    <div class="show_sanpham5">
                                        <div class="hinh_anh_sp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc'].'&mode=detail' ?>"><img width="160" height="115" src="<?php echo 'admin/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                        <div class="tensp"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc'].'&mode=detail' ?>"><?php echo ''.$item['ten_san_pham'].'' ?></a></div>           
                                    </div>
                             <?php 
                               }
                            ?>
                        
                    </div>
                  
                <!-- ket thuc nha va thiet bi nuoi yen -->
                
                
                <!-- bat dau cac cong trinh da thuc hien -->
                
                <div id="duandathuchien">
                    <div class="tieude" id="tieude_duandathuchien"><h3>dự án đã thực hiện</h3></div>
                    <MARQUEE  height="230" sscrollAmount="1" direction="right" loop="true" truespeed scrolldelay="80" onMouseOver="this.stop()" onMouseOut="this.start()">
                 
                        <?php
                            $sql5='select * from tbl_cac_san_pham_da_thuc_hien where hien_len_trang_chu=1 limit 3'; 
                            $kq5=tep_db_query($sql5);
                            while($item=tep_db_fetch_array($kq5)){?>
                                <div class="show_sanpham1">
                                    <div class="hinh_anh_sp"><a href="<?php echo '?page=sanphamdathuchien&masp='.$item['id'].'' ?>"><img width="233" height="230" src="<?php echo 'admin/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                    <div class="tensp"><?php echo ''.$item['ten_san_pham'].'' ?></div>           
                                </div>
                         <?php 
                           }
                        ?>
                    </MARQUEE>
                </div>
                
                <!-- ket thuc cac cong trinh da thuc hien -->
                
                
                
                <!-- bat dau san pham to yen -->
                
                 <div id="sanphamtoyen">
                    <div class="tieude" id="tieude_sanphamtoyen"><h3>sản phẩm tổ yến</h3></div>
                        <?php
                            $sql5='select * from tbl_san_pham order by id desc limit 2'; 
                            $kq5=tep_db_query($sql5);
                            while($item=tep_db_fetch_array($kq5)){?>
                                <div class="show_sanpham2">
                                    <div class="show_sp_to_yen">
                                        <div class="hinh_anh_sp2"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc'].'&mode=detail' ?>"><img width="160" height="115" src="<?php echo 'admin/upload/'.$item['hinh_anh'].'' ?>" /></a></div>
                                        <div class="tensp2"><a href="<?php echo '?page=sanpham&masp='.$item['id'].'&madanhmucsp='.$item['ma_danh_muc'].'&mode=detail' ?>"><?php echo ''.$item['ten_san_pham'].'' ?></a></div>
                                        <div><?php echo ''.$item['mo_ta_ngan_gon'].'' ?></div>           
                                    </div>
                                </div>
                         <?php 
                           }
                        ?>
                    
                </div>
                
                <!-- ket thuc san pham to yen -->
            
            </div>
            <?php 
                }
            ?>
            <!-- ket thuc content -->
        </div>
        <!-- ket thuc main -->
        
        <!-- bat dau footer -->
        <div id="footer">
            
            <!-- bat dau noi dung footer -->
            <div id="noidung_footer">
                
                <div class="tt_cong_ty">
                    <p >CÔNG TY TNHH XD-DV YẾN SÀO SÀI GÒN VINA<br />
                        Địa Chỉ: 35 Nguyễn Xí, p.26, Q.Bình Thạnh, Tp.HCM<br />
                        Ðiện Thoại: (08)22478068 -  Fax:(08)<br />
                        Email: yensaolina@gmail.com - Website:yensaosaigonvina.com
                    </p>
                </div>
                 <div class="desgin">Design bởi công ty<a href="http://www.vietconnet.com" style="font-weight: bold; color: white;text-decoration: none;"> MẠNG KẾT NỐI VIỆT</a>
                 - cung cấp <a href="http://www.vietconnet.com/VN/Index.aspx?P=151&knv=1&knv1=1" style="font-weight: bold; color: white; text-decoration: none;">
                 thông tin doanh nghiệp</a>, 
                <a href="http://www.vietconnet.com/VN/Index.aspx?P=5" style="font-weight: bold; color: white;text-decoration: none;">thiết kế web</a>, 
                <a href="http://www.baogiaquangcaogoogle.com" style="font-weight: bold; color: white;text-decoration: none;">google adwords</a> hàng đầu VN.</div>
           
        </div>
            </div>
            <!-- ket thuc noi dung footer -->
        </div>
        <!-- ket thuc footer -->
    
    </div>
    
    
    <!-- ket thuc warrper -->

</body>
</html>